﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using VMExplorer.Dynamic;

namespace VMExplorer.MemoryObjects
{
	abstract class RemoteMemoryObject<T> : RemoteTypeWrapper<T>, IMemoryObject where T:struct
  {
    #region Construction

    protected RemoteMemoryObject (SafeProcessHandle hProcess, MemoryAddress baseAddress, RegionUsage type)
			: base (hProcess, baseAddress)
		{
      Ranges = new List<RegionInfo> ();
			Stats = new MemoryObjectStats (this);
      Name = "(UNNAMED)";
      Type = type;
    }

    #endregion
    #region IMemoryObject Members

    public virtual string Name { get; set; }
    public RegionUsage Type { get; protected set; }

		public virtual System.Windows.Forms.TabPage [] Tabs { get { return null; } }

    public List<RegionInfo> Ranges { get; private set; }
    public MemoryObjectStats Stats { get; private set; }

		public object ViewableStruct { get { return new FieldsToProperties (Inner); } }

		#endregion
	}
}
